package codeine.peers_status;

import javax.inject.Inject;

import org.apache.log4j.Logger;

import codeine.configuration.PathHelper;
import codeine.configuration.directory.PeersListJson;
import codeine.utils.TextFileUtils;

import com.google.gson.Gson;

public class PeersListStore {

	private static final Logger log = Logger.getLogger(PeersListStore.class);
	private @Inject	PeersListJson peersList;
	private @Inject PathHelper pathHelper;
	private @Inject Gson gson;
	
	public void store() {
		log.info("store version map");
		TextFileUtils.setContents(pathHelper.getPeersListFile(), gson.toJson(peersList));
	}
}
